
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>动感立方体</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        @keyframes r {
            from{
                transform:rotateX(0deg) rotateY(0deg)
            }
            to{
                transform:rotateX(360deg) rotateY(360deg)
            }
        }
        .box{width: 200px;
            height: 200px;
            perspective: 10000px;
            transform-style: preserve-3d;
            position: relative;
            animation: r 10s linear 0s infinite alternate;
        }
        .sc{
width: 200px;
height: 200px;
perspective:1000px;
margin-top: 50px;
margin-left:50px;
        }
        .sc:hover .box{
            transform: rotateX(360deg) rotateY(360deg);
        }
        .box div{
            position: absolute;
            width: 200px;
            height: 200px;
            display: block;
        }
        .qian{
            transform: translateZ(100px);
            background-color: aqua;
            opacity: 0.6;
        }
        .top{
            transform: rotateX(90deg)translateZ(100px);
            background-color: beige;
            opacity: 0.6;
        }
        .hou{
            transform:translateZ(-100px) ;
            background-color: red;
            opacity: 0.6;
        }
        .bottom{
            transform: rotateX(90deg) translateZ(-100px);
            background-color: pink;
            opacity: 0.6;
        }
        .left{
            transform: rotateY(90deg) translateZ(100px);
            background-color: black;
            opacity: 0.6;
        }
        .right{
            transform: rotateY(-90deg) translateZ(100px);
            background-color: purple;
            opacity: 0.6;
        }
img{
    width: 200px;
    height: inherit;
}
    </style>
</head>
<body><div class="sc">
    <div class="box">
<div class="qian"><img src="./图片/5.jpg" alt=""></div>
<div class="left"><img src="./图片/2.jpg" alt=""></div>
<div class="right"><img src="./图片/3.jpg" alt=""></div>
<div class="hou"><img src="./图片/4.jpg" alt=""></div>
<div class="top"><img src="./图片/6.jpg" alt=""></div>
<div class="bottom"><img src="./图片/7.jpg" alt=""></div>
</body>
</html>